# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-timecop
_gemname=${pkgname#ruby-}
pkgver=0.9.5
pkgrel=1
pkgdesc="A gem providing 'time travel' and 'time freezing' capabilities"
url="https://github.com/travisjeffery/timecop"
arch="noarch"
license="MIT"
depends="ruby"
options="!check"  # tests require dependencies we don't have yet
source="$pkgname-$pkgver.tar.gz::https://github.com/travisjeffery/$_gemname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files.
	cd "$gemdir"
	rm -r cache/ build_info/ doc/
	cd gems/$_gemname-$pkgver
	rm -r test/ Rakefile README* LICENSE
}

sha512sums="
0ecfe1106c002cf879572d8843be6202e26cc6a84b02e3ed49625b2407def8111baad800838fc73ce86631501a386c0e8f287d3bfb126db69b2fec2a0ffb1889  ruby-timecop-0.9.5.tar.gz
"
